package com.zide.system.domain.user.vo.result;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.zide.common.annotation.Excel;
import com.zide.common.annotation.Excels;
import com.zide.common.core.domain.entity.SysDept;
import com.zide.common.core.domain.entity.SysRole;
import com.zide.common.xss.Xss;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 石添
 * @date 2024/3/19 15:13
 */
@Schema(description = "系统用户结果集")
@Data
public class SystemUserResultVO implements Serializable {

    private Long userId;

    private Long deptId;

    private String username;

    private String nickname;

    private String email;

    private String mobile;

    private Integer sex;

    private String avatar;

    private Integer status;

    private String loginIp;

    private LocalDateTime loginDate;

    private LocalDateTime createTime;

    private String deptName;

    private String leader;

    private SysDept dept;

    private List<SysRole> roles;

    private Long[] roleIds;

    private Long[] postIds;

    private Long roleId;

    public boolean isAdmin() {
        return isAdmin(this.userId);
    }

    public static boolean isAdmin(Long userId) {
        return userId != null && 1L == userId;
    }
}
